import { HttpClient } from "../../../../service/Http/HttpClient";
// import fly from "../../../../service/Http/fly";

const baseUrl = "/api";
/**部门模块开始 */
//获取项目所有部门
export const getfindAllDepartment = () => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/system/org/findAll", {
    method: "POST",
    headers: {},
  });
};

//模糊查询获取项目部门
export const getOrgListDepartment = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/getOrgList", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//删除部门
export const onDelete = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/delete", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//新增
export const AddDepartment = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/add", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//编辑
export const EditDepartment = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/update", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//部门的未绑定设备
export const getUnboundDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/getUnboundDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//部门已绑定设备
export const getBoundDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/getBoundDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//绑定设备
export const boundDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/boundDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//解绑设备
export const unBoundDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/org/unBoundDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
/**部门模块结束 */
/*建筑管理 开始*/
//模糊查询获取项目建筑
export const getfindFilesBuildList = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/build/findFilesBuildList", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//增加/修改项目建筑
export const saveBuild = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/build/save", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//删除项目建筑
export const deleteBuild = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/build/delete", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
///files/device/getDevicesByBuildId
//查询建筑绑定的设备列表
export const getDevicesByBuildId = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/device/getDevicesByBuildId", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//建筑绑定设备
export const rebindBatch = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/build/rebindBatch", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//建筑解绑设备
export const unbindBatch = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/files/build/unbindBatch", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
/*建筑管理 结束*/
/*分项管理开始 */
//项目所有设备分项查询
export const getBaseDeviceType = (pream: any) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/device/getBaseDeviceType", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//设备分项分页查询
export const getDeviceTypeByPage = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/device/getDeviceTypeByPage", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//新增分项
export const addDeviceType = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/device/addDeviceType", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//删除分项
export const deleteDeviceType = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/device/deleteDeviceType", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//编辑分项
export const updateDeviceType = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/device/updateDeviceType", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
/*分项管理结束 */
/*线损分析对象定义 开始*/
//线损分析对象列表
export const getFilesLineLossByName = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/getFilesLineLossByName", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//新增线损分析对象
export const addFilesLineLoss = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/addFilesLineLoss", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//删除线损分析对象
export const deleteFilesLineLoss = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/deleteFilesLineLoss", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//编辑线损分析对象
export const updateFilesLineLoss = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/updateFilesLineLoss", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//已绑定的供入设备查询
export const getBindInDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/getBindInDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//未绑定的供入设备查询
export const getUnBindInDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/getUnBindInDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//已绑定的供出设备查询
export const getBindOutDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/getBindOutDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//未绑定的供出设备查询
export const getUnBindOutDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/getUnBindOutDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//绑定或取消，未绑定或已绑定的供入设备
export const configureInDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/configureInDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//绑定或取消，未绑定或已绑定的供出设备
export const configureOutDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/ems/basecfg/linelossobject/configureOutDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
/*线损分析对象定义 结束*/
/**协议参数 开始 */
//所属项目协议查询
export const getPeProtocalTypeList = () => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/baseProtocal/getPeProtocalTypeList", {
    method: "POST",
    headers: {},
  });
};
//平台协议查询;
export const getPfProtocalTypeList = () => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/baseProtocal/getPfProtocalTypeList", {
    method: "POST",
    headers: {},
  });
};
//新增项目协议
export const addBaseProtocalParam = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/baseProtocal/addBaseProtocalParam", {
    method: "POST",
    headers: {},
    body: pream,
  });
};

//查看协议参数
export const findParamsByProtocolId = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/baseProtocal/findParamsByProtocolId", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//修改协议参数
export const updateProtocolParaVal = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/api/system/baseProtocal/updateProtocolParaVal", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
/**协议参数 结束 */
/**价格档案 开始*/
//价格档案分页查询
export const getPricePageData = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/wj/ems/basecfg/tariff/getPricePageData", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//价格档案更新
export const updatePriceData = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/wj/ems/basecfg/tariff/update", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//价格档案更新状态
export const updateStatus = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/wj/ems/basecfg/tariff/updateStatus", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//价格档案删除
export const deletePriceData = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/wj/ems/basecfg/tariff/delete", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//价格档案新增
export const addPriceData = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch("/wj/ems/basecfg/tariff/add", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
/**价格档案 结束*/
